{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "vscode": {
     "languageId": "plaintext"
    }
   },
   "source": [
    "# Structured Report Generation\n",
    "[![ Click here to deploy.](https://brev-assets.s3.us-west-1.amazonaws.com/nv-lb-dark.svg)](https://console.brev.dev/launchable/deploy?launchableID=env-2qzwjeLSpDcjU68lNQyDcZwxmn9)\n",
    "\n",
    "Deploy with Launchables. Launchables are pre-configured, fully optimized environments that users can deploy with a single click.\n",
    "\n",
    "In this notebook, you will use the newest llama model, llama-3.3-70b, to generate a report on a given topic. You will use Langchain's LangGraph to build an Agent that takes in user-defined topics and structure, then plans the topics of the section indicated in the structure. Next, the Agent uses Elasticsearch to do local search on the and uses this information to write the sections and synthesize the final report. \n",
    "\n",
    "Rather than deploying the model locally, you leverage NVIDIA API Catalog by calling the model's NIM API Endpoint. As you don't need a GPU to run the model, you can run this notebook anywhere!\n",
    "\n",
    "You can find the original notebook on LangChain's GitHub [here](https://github.com/langchain-ai/report-mAIstro).\n",
    "\n",
    "Below is the architecture diagram.\n",
    "\n",
    "# ![Architecture Diagram]()\n",
    "\n",
    "\n",
    "\n",
    "The Agent takes in user defined topics and structure, then plans the topics of the section indicated in the structure. The Agent then uses Elasticsearch to do search and uses this information to write the sections and synthesize the final report. \n",
    "\n",
    " \n",
    "A two-phase approach is used for planning and research: \n",
    "\n",
    "\n",
    "Phase 1 - Planning \n",
    "- Analyzes user inputs \n",
    "- Maps out report sections \n",
    "\n",
    " \n",
    "Phase 2 - Research \n",
    "- Conducts parallel local research via Elasticsearch\n",
    "- Processes relevant data for each section \n",
    "\n",
    " \n",
    "\n",
    "The report is then written in a strategic sequence: \n",
    "- Write research-based sections in parallel \n",
    "- Write introductions, conclusions, and connect each of the sections  \n",
    "\n",
    "\n",
    "All sections maintain awareness of each other's content for consistency. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Content Overview\n",
    ">[Prerequisites](#Prerequisites)  \n",
    ">[Writing Report Plan](#Writing-Report-Plan)  \n",
    ">[Research and Writing](#Research-and-Writing)  \n",
    ">[Write Single Section](#Write-Single-Section)  \n",
    ">[Validate Single Section](#Validate-Single-Section)  \n",
    ">[Write All Sections](#Write-All-Sections)  \n",
    ">[Validate Final Report](#Final-Report)\n",
    "________________________\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prerequisites\n",
    "\n",
    "### Install Dependencies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%capture --no-stderr\n",
    "%pip install --quiet -U langgraph langchain_community langchain_core elasticsearch langchain_nvidia_ai_endpoints"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## API Keys\n",
    "Prior to getting started, you will need to create API Keys for the NVIDIA API Catalog, Elasticsearch, and LangChain.\n",
    "\n",
    "- NVIDIA NIM Trial API Key\n",
    "  1. Prior to getting started, you will need to create API Keys to access NVIDIA NIM trial hosted endpoints.\n",
    "  2. If you don’t have an NVIDIA account, you will be asked to sign-up. Each user gets a 1000 API trial credits upon signup to try NVIDIA NIM models.\n",
    "  3. Click [here](https://build.nvidia.com/meta/llama-3_3-70b-instruct?signin=true&api_key=true) to sign-in and get an API key\n",
    "- LangChain\n",
    "  1. Go to **[LangChain Settings page](https://smith.langchain.com/settings)**. You will need to create an account if you have not already.\n",
    "  2. On the left panel, navigate to \"API Keys\".\n",
    "  3. Click on the \"Create API Key\" on the top right of the page.\n",
    "- Elasticsearch\n",
    "  1. Launch your Elasticsearch instance.\n",
    "  2. Have a server with an index\n",
    "  3. Prepare to run search queries\n",
    "\n",
    "### Export API Keys\n",
    "\n",
    "Save these API Keys as environment variables.\n",
    "\n",
    "First, set the NVIDIA API Key as the environment variable."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "import getpass\n",
    "import os\n",
    "\n",
    "from dotenv import load_dotenv\n",
    "\n",
    "load_dotenv()\n",
    "\n",
    "if not os.environ.get(\"NVIDIA_API_KEY\", \"\").startswith(\"nvapi-\"):\n",
    "    nvapi_key = getpass.getpass(\"Enter your NVIDIA API key: \")\n",
    "    assert nvapi_key.startswith(\"nvapi-\"), f\"{nvapi_key[:5]}... is not a valid key\"\n",
    "    os.environ[\"NVIDIA_API_KEY\"] = nvapi_key"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "vscode": {
     "languageId": "plaintext"
    }
   },
   "source": [
    "Next, set the LangChain API Key as an environment variable. You will use [LangSmith](https://docs.smith.langchain.com/) for [tracing](https://docs.smith.langchain.com/concepts/tracing)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os, getpass\n",
    "\n",
    "def _set_env(var: str):\n",
    "    if not os.environ.get(var):\n",
    "        os.environ[var] = getpass.getpass(f\"{var}: \")\n",
    "        \n",
    "# _set_env(\"LANGCHAIN_API_KEY\")\n",
    "# os.environ[\"LANGCHAIN_TRACING_V2\"] = \"false\"\n",
    "# os.environ[\"LANGCHAIN_PROJECT\"] = \"report-mAIstro\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Finally, set the Elasticsearch credentials as environment variables. You will use Elasticsearch for storing and searching documents."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "_set_env(\"ELASTIC_HOST\")\n",
    "_set_env(\"ELASTIC_PORT\")\n",
    "_set_env(\"ELASTIC_INDEX\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/zvilapp/Dev/nvidia-zvi/report-mAIstro/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020\n",
      "  warnings.warn(\n"
     ]
    }
   ],
   "source": [
    "from elasticsearch import Elasticsearch, AsyncElasticsearch\n",
    "es_client = Elasticsearch(\n",
    "    hosts=[f\"http://{os.environ['ELASTIC_HOST']}:{os.environ['ELASTIC_PORT']}\"],\n",
    ")\n",
    "es_async_client = AsyncElasticsearch(\n",
    "    hosts=[f\"http://{os.environ['ELASTIC_HOST']}:{os.environ['ELASTIC_PORT']}\"],\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'name': 'a6e978a3b78d', 'cluster_name': 'docker-cluster', 'cluster_uuid': 'EdAyQ7HrT9eNYUYe28DMiA', 'version': {'number': '8.9.0', 'build_flavor': 'default', 'build_type': 'docker', 'build_hash': '8aa461beb06aa0417a231c345a1b8c38fb498a0d', 'build_date': '2023-07-19T14:43:58.555259655Z', 'build_snapshot': False, 'lucene_version': '9.7.0', 'minimum_wire_compatibility_version': '7.17.0', 'minimum_index_compatibility_version': '7.0.0'}, 'tagline': 'You Know, for Search'}\n",
      "<coroutine object AsyncElasticsearch.info at 0x109b27bc0>\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/lv/ln30yww17sz3yld2fg7gvzf00000gn/T/ipykernel_31455/1816226475.py:3: RuntimeWarning: coroutine 'AsyncElasticsearch.info' was never awaited\n",
      "  print(es_async_client.info())\n",
      "RuntimeWarning: Enable tracemalloc to get the object allocation traceback\n"
     ]
    }
   ],
   "source": [
    "# Test the connection to Elasticsearch\n",
    "print(es_client.info())\n",
    "print(es_async_client.info())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Working with the NVIDIA API Catalog\n",
    "\n",
    "Let's test the API endpoint.\n",
    "\n",
    "In this notebook, you will use the newest llama model, llama-3.3-70b-instruct, as the LLM. Define the LLM below and test the API Catalog.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(Verse 1)  \n",
      "In the realm of code and dreams,  \n",
      "Where data flows like endless streams,  \n",
      "A chain was forged with links so bright,  \n",
      "To guide us through the endless night.  \n",
      "\n",
      "LangChain, oh beacon of the wise,  \n",
      "In your embrace, the future lies,  \n",
      "With every node and every thread,  \n",
      "You weave the paths where knowledge's spread.  \n",
      "\n",
      "(Chorus)  \n",
      "Oh, LangChain, guide us through the storm,  \n",
      "In your logic, we find form,  \n",
      "From scattered thoughts to structured lore,  \n",
      "You open wide the data's door.  \n",
      "\n",
      "(Verse 2)  \n",
      "In the halls of silicon and light,  \n",
      "Where shadows dance with bytes in flight,  \n",
      "You stand as sentinel and guide,  \n",
      "A bridge where human minds reside.  \n",
      "\n",
      "With every query, every call,  \n",
      "You answer with a wisdom tall,  \n",
      "From language deep to surface plain,  \n",
      "You bind the links in your domain.  \n",
      "\n",
      "(Chorus)  \n",
      "Oh, LangChain, guide us through the storm,  \n",
      "In your logic, we find form,  \n",
      "From scattered thoughts to structured lore,  \n",
      "You open wide the data's door.  \n",
      "\n",
      "(Bridge)  \n",
      "Through the labyrinth of code we tread,  \n",
      "With LangChain's light, we forge ahead,  \n",
      "In every challenge, every quest,  \n",
      "You stand beside us, ever blessed.  \n",
      "\n",
      "(Verse 3)  \n",
      "So let us sing of LangChain's might,  \n",
      "A ballad for the endless night,  \n",
      "For in its chains, we find our way,  \n",
      "To brighter dawns and clearer day.  \n",
      "\n",
      "(Chorus)  \n",
      "Oh, LangChain, guide us through the storm,  \n",
      "In your logic, we find form,  \n",
      "From scattered thoughts to structured lore,  \n",
      "You open wide the data's door.  \n",
      "\n",
      "(Outro)  \n",
      "In the tapestry of time and space,  \n",
      "LangChain holds a cherished place,  \n",
      "A testament to human skill,  \n",
      "A dream fulfilled, a future still.  \n"
     ]
    }
   ],
   "source": [
    "from langchain_nvidia_ai_endpoints import ChatNVIDIA\n",
    "\n",
    "llm = ChatNVIDIA(model=\"deepseek-ai/deepseek-r1\", temperature=0)\n",
    "result = llm.invoke(\"Write a ballad about LangChain.\")\n",
    "print(result.content)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Optional: Locally Run NVIDIA NIM Microservices"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Once you familiarize yourself with this blueprint, you may want to self-host models with NVIDIA NIM Microservices using NVIDIA AI Enterprise software license. This gives you the ability to run models anywhere, giving you ownership of your customizations and full control of your intellectual property (IP) and AI applications.\n",
    "\n",
    "[Learn more about NIM Microservices](https://developer.nvidia.com/blog/nvidia-nim-offers-optimized-inference-microservices-for-deploying-ai-models-at-scale/)\n",
    "\n",
    "<div class=\"alert alert-block alert-success\">\n",
    "<b>NOTE:</b> Run the following cell only if you're using a local NIM Microservice instead of the API Catalog Endpoint.\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain_nvidia_ai_endpoints import ChatNVIDIA\n",
    "\n",
    "# connect to an embedding NIM running at localhost:8000, specifying a model\n",
    "# llm = ChatNVIDIA(base_url=\"http://localhost:8000/v1\", model=\"meta/llama3-8b-instruct\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Writing Report Plan"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Structure\n",
    "report_structure = \"\"\"This report type focuses on comparative analysis of weather conditions across various locations.\n",
    "\n",
    "The report structure should include:\n",
    "1. Introduction (no research needed)\n",
    "   - Brief overview of weather patterns and the significance of weather analysis\n",
    "   - Context for comparing weather across different regions\n",
    "\n",
    "2. Main Body Sections:\n",
    "   - One dedicated section for EACH location provided in the user-provided list\n",
    "   - Each section should examine:\n",
    "     - Current Weather Conditions (bulleted list including temperature, humidity, precipitation, etc.)\n",
    "     - Historical Trends & Patterns (2-3 sentences summarizing past weather data)\n",
    "     - Notable Weather Events or Anomalies (2-3 sentences highlighting any unusual or significant events)\n",
    "   \n",
    "3. No Main Body Sections other than the ones dedicated to each location in the user-provided list\n",
    "\n",
    "4. Conclusion with Comparison Table (no research needed)\n",
    "   - Structured comparison table that:\n",
    "     * Compares all locations across key weather dimensions (e.g., temperature range, precipitation levels, humidity)\n",
    "     * Highlights similarities and differences between regions\n",
    "   - Final summary with key insights and recommendations for further observation\"\"\"\n",
    "\n",
    "\n",
    "# Topic \n",
    "report_topic = \"Provide a comprehensive weather analysis comparing current conditions, historical trends, and notable events for the following locations: New York, London, Tokyo, and Sydney.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Creating Utils Functions\n",
    "\n",
    "Next, you will create Utility functions that will be used for web research during report generation."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "import asyncio\n",
    "from langsmith import traceable\n",
    "from pydantic import BaseModel, Field\n",
    "\n",
    "class Section(BaseModel):\n",
    "    name: str = Field(\n",
    "        description=\"Name for this section of the report.\",\n",
    "    )\n",
    "    description: str = Field(\n",
    "        description=\"Brief overview of the main topics and concepts to be covered in this section.\",\n",
    "    )\n",
    "    research: bool = Field(\n",
    "        description=\"Whether to perform web research for this section of the report.\"\n",
    "    )\n",
    "    content: str = Field(\n",
    "        description=\"The content of the section.\"\n",
    "    ) \n",
    "\n",
    "def extract_search_terms(query: str) -> dict:\n",
    "    \"\"\"\n",
    "    Extract relevant search terms from natural language query.\n",
    "    \n",
    "    Args:\n",
    "        query (str): Natural language query\n",
    "        \n",
    "    Returns:\n",
    "        dict: Structured search terms\n",
    "    \"\"\"\n",
    "    # Common city prefixes to handle special cases\n",
    "    city_prefixes = [\"New York\", \"Rio de Janeiro\", \"San Francisco\", \"Cape Town\"]\n",
    "    \n",
    "    # Extract city name\n",
    "    city = None\n",
    "    for prefix in city_prefixes:\n",
    "        if prefix in query:\n",
    "            city = prefix\n",
    "            break\n",
    "    \n",
    "    if not city:\n",
    "        # Take first word as city if no prefix match\n",
    "        city = query.split()[0]\n",
    "    \n",
    "    # Extract country if present\n",
    "    countries = [\"USA\", \"UK\", \"Japan\", \"Australia\", \"France\", \"Germany\", \"Russia\", \"China\", \"Brazil\", \"India\"]\n",
    "    country = next((c for c in countries if c in query), None)\n",
    "    \n",
    "    return {\n",
    "        \"city\": city,\n",
    "        \"country\": country\n",
    "    }\n",
    "\n",
    "def deduplicate_and_format_sources(search_response, max_tokens_per_source, include_raw_content=True):\n",
    "    \"\"\"\n",
    "    Takes either a single search response or list of responses from Elasticsearch and formats them.\n",
    "    \n",
    "    Args:\n",
    "        search_response: List of Elasticsearch response objects\n",
    "        max_tokens_per_source: Maximum tokens to include per source\n",
    "        include_raw_content: Whether to include full content\n",
    "            \n",
    "    Returns:\n",
    "        str: Formatted string with weather data sources\n",
    "    \"\"\"\n",
    "    # Initialize formatted text\n",
    "    formatted_text = \"Weather Data Sources:\\n\\n\"\n",
    "    \n",
    "    # Get Elasticsearch connection details from environment\n",
    "    es_host = os.environ['ELASTIC_HOST']\n",
    "    es_port = os.environ['ELASTIC_PORT']\n",
    "    es_index = os.environ['ELASTIC_INDEX']\n",
    "    \n",
    "    # Track unique documents to avoid duplicates\n",
    "    seen_docs = set()\n",
    "    \n",
    "    # Process each response\n",
    "    for response in search_response:\n",
    "        if 'hits' in response and 'hits' in response['hits']:\n",
    "            for hit in response['hits']['hits']:\n",
    "                # Validate Elasticsearch document structure\n",
    "                if not all(key in hit for key in ['_id', '_source', '_score']):\n",
    "                    continue\n",
    "                    \n",
    "                doc_id = hit['_id']\n",
    "                \n",
    "                # Skip if we've already seen this document\n",
    "                if doc_id in seen_docs:\n",
    "                    continue\n",
    "                seen_docs.add(doc_id)\n",
    "                \n",
    "                data = hit['_source']\n",
    "                # Create direct link to Elasticsearch document\n",
    "                doc_url = f\"http://{es_host}:{es_port}/{es_index}/_doc/{doc_id}\"\n",
    "                \n",
    "                formatted_text += f\"## Elasticsearch Document: [{doc_id}]({doc_url})\\n\"\n",
    "                formatted_text += f\"- **Location**: {data.get('city', 'N/A')}, {data.get('country', 'N/A')}\\n\"\n",
    "                formatted_text += f\"- **Temperature**: {data.get('temperature', 'N/A')}°C\\n\"\n",
    "                formatted_text += f\"- **Conditions**: {data.get('condition', 'N/A')}\\n\"\n",
    "                formatted_text += f\"- **Last Updated**: {data.get('timestamp', 'N/A')}\\n\"\n",
    "                formatted_text += f\"- **Relevance Score**: {hit['_score']:.2f}\\n\"\n",
    "                formatted_text += \"\\n\"\n",
    "    \n",
    "    # If no results were found, provide a message\n",
    "    if not seen_docs:\n",
    "        formatted_text += \"No relevant Elasticsearch documents found for the specified locations.\\n\"\n",
    "    \n",
    "    return formatted_text.strip()\n",
    "\n",
    "def format_sections(sections: list[Section]) -> str:\n",
    "    \"\"\" Format a list of sections into a string \"\"\"\n",
    "    formatted_str = \"\"\n",
    "    for idx, section in enumerate(sections, 1):\n",
    "        formatted_str += f\"\"\"\n",
    "{'='*60}\n",
    "Section {idx}: {section.name}\n",
    "{'='*60}\n",
    "Description:\n",
    "{section.description}\n",
    "Requires Research: \n",
    "{section.research}\n",
    "\n",
    "Content:\n",
    "{section.content if section.content else '[Not yet written]'}\n",
    "\n",
    "\"\"\"\n",
    "    return formatted_str\n",
    "\n",
    "@traceable\n",
    "def es_search(query):\n",
    "    \"\"\" Search the web using the Elasticsearch API.\n",
    "    \n",
    "    Args:\n",
    "        query (json): The search query to execute\n",
    "        \n",
    "    Returns:\n",
    "        dict: Elasticsearch search response containing:\n",
    "            - results (list): List of search result dictionaries, each containing:\n",
    "                - title (str): Title of the search result\n",
    "                - url (str): URL of the search result\n",
    "                - content (str): Snippet/summary of the content\n",
    "                - raw_content (str): Full content of the page if available\"\"\"\n",
    "     \n",
    "    return es_client.search(query, \n",
    "                         max_results=5, \n",
    "                         include_raw_content=True)\n",
    "\n",
    "@traceable\n",
    "async def es_search_async(search_queries):\n",
    "    \"\"\"\n",
    "    Performs concurrent weather data searches using the Elasticsearch API.\n",
    "    \n",
    "    Args:\n",
    "        search_queries (List[str]): List of search queries to process\n",
    "        \n",
    "    Returns:\n",
    "        List[dict]: List of search results from Elasticsearch API\n",
    "    \"\"\"\n",
    "    \n",
    "    search_tasks = []\n",
    "    for query in search_queries:\n",
    "        # Extract search terms from natural language query\n",
    "        search_terms = extract_search_terms(query)\n",
    "        \n",
    "        # Build Elasticsearch query\n",
    "        es_query = {\n",
    "            \"bool\": {\n",
    "                \"must\": [\n",
    "                    {\"match\": {\"city\": search_terms[\"city\"]}}\n",
    "                ]\n",
    "            }\n",
    "        }\n",
    "        \n",
    "        # Add country to query if present\n",
    "        if search_terms[\"country\"]:\n",
    "            es_query[\"bool\"][\"must\"].append(\n",
    "                {\"match\": {\"country\": search_terms[\"country\"]}}\n",
    "            )\n",
    "        \n",
    "        search_tasks.append(\n",
    "            es_async_client.search(\n",
    "                index=\"weather\",\n",
    "                query=es_query,\n",
    "                size=5\n",
    "            )\n",
    "        )\n",
    "\n",
    "    # Execute all searches concurrently\n",
    "    search_docs = await asyncio.gather(*search_tasks)\n",
    "    return search_docs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Planning\n",
    "\n",
    "First, let's define the Schema for report sections."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing_extensions import TypedDict\n",
    "from typing import  Annotated, List, Optional, Literal\n",
    "  \n",
    "class Sections(BaseModel):\n",
    "    sections: List[Section] = Field(\n",
    "        description=\"Sections of the report.\",\n",
    "    )\n",
    "class SearchQuery(BaseModel):\n",
    "    search_query: str = Field(\n",
    "        None, description=\"Query for web search.\"\n",
    "    )\n",
    "class Queries(BaseModel):\n",
    "    queries: List[SearchQuery] = Field(\n",
    "        description=\"List of search queries.\",\n",
    "    )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now you will define the LangGraph state. Each state will have the following fields. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "import operator\n",
    "\n",
    "class ReportState(TypedDict):\n",
    "    topic: str # Report topic\n",
    "    report_structure: str # Report structure\n",
    "    number_of_queries: int # Number web search queries to perform per section    \n",
    "    sections: list[Section] # List of report sections \n",
    "    completed_sections: Annotated[list, operator.add] # Send() API key\n",
    "    report_sections_from_research: str # String of any completed sections from research to write final sections\n",
    "    final_report: str # Final report"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next you will write the report planner instructions, and a function that will generate the report sections."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain_core.messages import HumanMessage, SystemMessage\n",
    "\n",
    "# Prompt to generate a search query to help with planning the report outline\n",
    "report_planner_query_writer_instructions=\"\"\"You are an expert technical writer, helping to plan a report. \n",
    "\n",
    "The report will be focused on the following topic:\n",
    "\n",
    "{topic}\n",
    "\n",
    "The report structure will follow these guidelines:\n",
    "\n",
    "{report_organization}\n",
    "\n",
    "Your goal is to generate {number_of_queries} search queries that will help gather comprehensive information for planning the report sections. \n",
    "\n",
    "The query should:\n",
    "\n",
    "1. Be related to the topic \n",
    "2. Help satisfy the requirements specified in the report organization\n",
    "\n",
    "Make the query specific enough to find high-quality, relevant sources while covering the breadth needed for the report structure.\"\"\"\n",
    "\n",
    "# Prompt generating the report outline\n",
    "report_planner_instructions=\"\"\"You are an expert technical writer, helping to plan a report.\n",
    "\n",
    "Your goal is to generate the outline of the sections of the report. \n",
    "\n",
    "The overall topic of the report is:\n",
    "\n",
    "{topic}\n",
    "\n",
    "The report should follow this organization: \n",
    "\n",
    "{report_organization}\n",
    "\n",
    "You should reflect on this information to plan the sections of the report: \n",
    "\n",
    "{context}\n",
    "\n",
    "Now, generate the sections of the report. Each section should have the following fields:\n",
    "\n",
    "- Name - Name for this section of the report.\n",
    "- Description - Brief overview of the main topics and concepts to be covered in this section.\n",
    "- Research - Whether to perform web research for this section of the report.\n",
    "- Content - The content of the section, which you will leave blank for now.\n",
    "\n",
    "Consider which sections require web research. For example, introduction and conclusion will not require research because they will distill information from other parts of the report.\"\"\"\n",
    "\n",
    "async def generate_report_plan(state: ReportState):\n",
    "\n",
    "    # Inputs\n",
    "    topic = state[\"topic\"]\n",
    "    report_structure = state[\"report_structure\"]\n",
    "    number_of_queries = state[\"number_of_queries\"]\n",
    "\n",
    "    # Convert JSON object to string if necessary\n",
    "    if isinstance(report_structure, dict):\n",
    "        report_structure = str(report_structure)\n",
    "\n",
    "    # Generate search query\n",
    "    structured_llm = llm.with_structured_output(Queries)\n",
    "    \n",
    "    # Format system instructions\n",
    "    system_instructions_query = report_planner_query_writer_instructions.format(topic=topic, report_organization=report_structure, number_of_queries=number_of_queries)\n",
    "    \n",
    "    # Generate queries  \n",
    "    results = structured_llm.invoke([SystemMessage(content=system_instructions_query)]+[HumanMessage(content=\"Generate search queries that will help with planning the sections of the report.\")])\n",
    "    \n",
    "    # Web search\n",
    "    query_list = [query.search_query for query in results.queries]\n",
    "    search_docs = await es_search_async(query_list)\n",
    "\n",
    "    # Deduplicate and format sources\n",
    "    source_str = deduplicate_and_format_sources(search_docs, max_tokens_per_source=1000, include_raw_content=True)\n",
    "\n",
    "    # Format system instructions\n",
    "    system_instructions_sections = report_planner_instructions.format(topic=topic, report_organization=report_structure, context=source_str)\n",
    "\n",
    "    # Generate sections \n",
    "    structured_llm = llm.with_structured_output(Sections)\n",
    "    report_sections = structured_llm.invoke([SystemMessage(content=system_instructions_sections)]+[HumanMessage(content=\"Generate the sections of the report. Your response must include a 'sections' field containing a list of sections. Each section must have: name, description, plan, research, and content fields.\")])\n",
    "    \n",
    "    return {\"sections\": report_sections.sections}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's run the agent. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "==================================================\n",
      "Name: Introduction\n",
      "Description: This section provides a brief overview of weather patterns and the significance of weather analysis, as well as the context for comparing weather across different regions.\n",
      "Research: False\n",
      "==================================================\n",
      "Name: New York Weather Analysis\n",
      "Description: This section examines the current weather conditions, historical trends, and notable weather events or anomalies for New York, USA.\n",
      "Research: True\n",
      "==================================================\n",
      "Name: London Weather Analysis\n",
      "Description: This section examines the current weather conditions, historical trends, and notable weather events or anomalies for London, UK.\n",
      "Research: True\n",
      "==================================================\n",
      "Name: Tokyo Weather Analysis\n",
      "Description: This section examines the current weather conditions, historical trends, and notable weather events or anomalies for Tokyo, Japan.\n",
      "Research: True\n",
      "==================================================\n",
      "Name: Sydney Weather Analysis\n",
      "Description: This section examines the current weather conditions, historical trends, and notable weather events or anomalies for Sydney, Australia.\n",
      "Research: True\n",
      "==================================================\n",
      "Name: Conclusion with Comparison Table\n",
      "Description: This section includes a structured comparison table that compares all locations across key weather dimensions and highlights similarities and differences between regions. It also provides a final summary with key insights and recommendations for further observation.\n",
      "Research: False\n"
     ]
    }
   ],
   "source": [
    "# Generate report plan\n",
    "sections = await generate_report_plan({\"topic\": report_topic, \"report_structure\": report_structure, \"number_of_queries\": 2})\n",
    "\n",
    "# Print sections\n",
    "for section in sections['sections']:\n",
    "    print(f\"{'='*50}\")\n",
    "    print(f\"Name: {section.name}\")\n",
    "    print(f\"Description: {section.description}\")\n",
    "    print(f\"Research: {section.research}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Research and Writing"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "Now you are ready to give the Agent details about which sections require research, and the number of queries needed.  Let's First you will define the LangGraph state. Each state will have the following fields. \n",
    "\n",
    "Let's define the LangGraph state. Each state will have the following fields:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "class SectionState(TypedDict):\n",
    "    number_of_queries: int # Number web search queries to perform per section \n",
    "    section: Section # Report section   \n",
    "    search_queries: list[SearchQuery] # List of search queries\n",
    "    source_str: str # String of formatted source content from web search\n",
    "    report_sections_from_research: str # String of any completed sections from research to write final sections\n",
    "    completed_sections: list[Section] # Final key we duplicate in outer state for Send() API\n",
    "\n",
    "class SectionOutputState(TypedDict):\n",
    "    completed_sections: list[Section] # Final key we duplicate in outer state for Send() API"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Write Single Section\n",
    "Now you will define the query writer instructions and the Agent function and nodes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAKsAAAGwCAIAAABZ7AKiAAAAAXNSR0IArs4c6QAAIABJREFUeJztnXdAFMfix2f3ej/g4OjdhoJAQBF7lBixQmxBYm9PRP2pSYzx5ZlmjCbGqLFEo0bRaIwdsRMbVkQTjZUuHe6AO+64uvv7Yw2Pp4AY7pjD2c9fd3u7c9+9/dxsm53BSJIENAiDww5AAxnaANShDUAd2gDUoQ1AHdoA1GHCDvASqsoN6kqTVmXWqk1GQ9s4cWWxMQYT44uZfBFD5sZmcxiwEzUFZpvXA0rzdFl3a3LuaqRytlFH8MUMgYTJYrWNGovNxaoVJq3KpFWblaUGRzeOb6Cg/RsiLt8WVbA5A5QlhivHKrgChp0T2ydQYC9nw07UUp4+1mbf1ZQ/1bn583sMdYAd53lsy4Arxypy/tJEDpP5dBbAzmJ50s8qrx1XRsXLO7whgp3lv9iQAb+szA8fZOff1YZ+HYtDkuTlwxUYjvUaIYOd5Rk2YYDZTG5clDXufQ+ZKwd2ltbg9u+V6kpTn1hH2EGATRhAmMkN72fNWe0PN0Yrk/F7ZXG2bshUF9hBbMCA3V/lDZ7i8hoc8b0qN08rzSYyIhrysSHk86tLh8sjhzsguPkBAOFv2ZsMRPbdGrgxYBpQkqcrydH5dBZCzACX4H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qbYjsnh2+6f/jnakgE01sCGrgfQQIE2AHVoA1CHNgB1aANQhzYAdf4fXElSmR2STroAAAAASUVORK5CYII=",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from IPython.display import Image, display\n",
    "from langgraph.graph import START, END, StateGraph\n",
    "\n",
    "# Query writer instructions\n",
    "query_writer_instructions=\"\"\"Your goal is to generate targeted web search queries that will gather comprehensive information for writing a technical report section.\n",
    "\n",
    "Topic for this section:\n",
    "{section_topic}\n",
    "\n",
    "When generating {number_of_queries} search queries, ensure they:\n",
    "1. Cover different aspects of the topic (e.g., core features, real-world applications, technical architecture)\n",
    "2. Include specific technical terms related to the topic\n",
    "3. Target recent information by including year markers where relevant (e.g., \"2024\")\n",
    "4. Look for comparisons or differentiators from similar technologies/approaches\n",
    "5. Search for both official documentation and practical implementation examples\n",
    "\n",
    "Your queries should be:\n",
    "- Specific enough to avoid generic results\n",
    "- Technical enough to capture detailed implementation information\n",
    "- Diverse enough to cover all aspects of the section plan\n",
    "- Focused on authoritative sources (documentation, technical blogs, academic papers)\"\"\"\n",
    "\n",
    "# Section writer instructions\n",
    "section_writer_instructions = \"\"\"You are an expert technical writer crafting one section of a technical report.\n",
    "\n",
    "Topic for this section:\n",
    "{section_topic}\n",
    "\n",
    "Guidelines for writing:\n",
    "\n",
    "1. Technical Accuracy:\n",
    "- Include specific version numbers\n",
    "- Reference concrete metrics/benchmarks\n",
    "- Cite official documentation\n",
    "- Use technical terminology precisely\n",
    "\n",
    "2. Length and Style:\n",
    "- Strict 150-200 word limit\n",
    "- No marketing language\n",
    "- Technical focus\n",
    "- Write in simple, clear language\n",
    "- Start with your most important insight in **bold**\n",
    "- Use short paragraphs (2-3 sentences max)\n",
    "\n",
    "3. Structure:\n",
    "- Use ## for section title (Markdown format)\n",
    "- Only use ONE structural element IF it helps clarify your point:\n",
    "  * Either a focused table comparing 2-3 key items (using Markdown table syntax)\n",
    "  * Or a short list (3-5 items) using proper Markdown list syntax:\n",
    "    - Use `*` or `-` for unordered lists\n",
    "    - Use `1.` for ordered lists\n",
    "    - Ensure proper indentation and spacing\n",
    "- End with ### Sources that references the below source material formatted as:\n",
    "  * List each source with title, date, and URL\n",
    "  * Format: `- Title : URL`\n",
    "\n",
    "3. Writing Approach:\n",
    "- Include at least one specific example or case study\n",
    "- Use concrete details over general statements\n",
    "- Make every word count\n",
    "- No preamble prior to creating the section content\n",
    "- Focus on your single most important point\n",
    "\n",
    "4. Use this source material to help write the section:\n",
    "{context}\n",
    "\n",
    "5. Quality Checks:\n",
    "- Exactly 150-200 words (excluding title and sources)\n",
    "- Careful use of only ONE structural element (table or list) and only if it helps clarify your point\n",
    "- One specific example / case study\n",
    "- Starts with bold insight\n",
    "- No preamble prior to creating the section content\n",
    "- Sources cited at end\"\"\"\n",
    "\n",
    "def generate_queries(state: SectionState):\n",
    "    \"\"\" Generate search queries for a section \"\"\"\n",
    "\n",
    "    # Get state \n",
    "    number_of_queries = state[\"number_of_queries\"]\n",
    "    section = state[\"section\"]\n",
    "\n",
    "    # Generate queries \n",
    "    structured_llm = llm.with_structured_output(Queries)\n",
    "\n",
    "    # Format system instructions\n",
    "    system_instructions = query_writer_instructions.format(section_topic=section.description, number_of_queries=number_of_queries)\n",
    "\n",
    "    # Generate queries  \n",
    "    queries = structured_llm.invoke([SystemMessage(content=system_instructions)]+[HumanMessage(content=\"Generate search queries on the provided topic.\")])\n",
    "\n",
    "    return {\"search_queries\": queries.queries}\n",
    "\n",
    "async def search_local(state: SectionState):\n",
    "    \"\"\" Search the web for each query, then return a list of raw sources and a formatted string of sources.\"\"\"\n",
    "    \n",
    "    # Get state \n",
    "    search_queries = state[\"search_queries\"]\n",
    "\n",
    "    print(f\"{'='*50}\")\n",
    "    print(f\"Search Queries: {search_queries}\")\n",
    "    print(f\"{'='*50}\")\n",
    "\n",
    "    # Web search\n",
    "    query_list = [query.search_query for query in search_queries]\n",
    "    search_docs = await es_search_async(query_list)\n",
    "    \n",
    "\n",
    "    print(f\"{'='*50}\")\n",
    "    print(f\"Query List: {query_list}\")\n",
    "    print(f\"{'='*50}\")\n",
    "    print(f\"Search Docs: {search_docs}\")\n",
    "    print(f\"{'='*50}\")\n",
    "    # Deduplicate and format sources\n",
    "    source_str = deduplicate_and_format_sources(search_docs, max_tokens_per_source=5000, include_raw_content=True)\n",
    "\n",
    "    return {\"source_str\": source_str}\n",
    "\n",
    "def write_section(state: SectionState):\n",
    "    \"\"\" Write a section of the report \"\"\"\n",
    "\n",
    "    # Get state \n",
    "    section = state[\"section\"]\n",
    "    source_str = state[\"source_str\"]\n",
    "\n",
    "    # Format system instructions\n",
    "    system_instructions = section_writer_instructions.format(section_title=section.name, section_topic=section.description, context=source_str)\n",
    "\n",
    "    # Generate section  \n",
    "    section_content = llm.invoke([SystemMessage(content=system_instructions)]+[HumanMessage(content=\"Generate a report section based on the provided sources.\")])\n",
    "    \n",
    "    # Write content to the section object  \n",
    "    section.content = section_content.content\n",
    "\n",
    "    # Write the updated section to completed sections\n",
    "    return {\"completed_sections\": [section]}\n",
    "\n",
    "# Add nodes and edges \n",
    "section_builder = StateGraph(SectionState, output=SectionOutputState)\n",
    "section_builder.add_node(\"generate_queries\", generate_queries)\n",
    "section_builder.add_node(\"search_local\", search_local)\n",
    "section_builder.add_node(\"write_section\", write_section)\n",
    "\n",
    "section_builder.add_edge(START, \"generate_queries\")\n",
    "section_builder.add_edge(\"generate_queries\", \"search_local\")\n",
    "section_builder.add_edge(\"search_local\", \"write_section\")\n",
    "section_builder.add_edge(\"write_section\", END)\n",
    "\n",
    "# Compile\n",
    "section_builder_graph = section_builder.compile()\n",
    "\n",
    "# View\n",
    "display(Image(section_builder_graph.get_graph(xray=1).draw_mermaid_png()))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Validate Single Section\n",
    "\n",
    "Call on the Agent to write a single section to ensure the content is generated as expected. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "==================================================\n",
      "Name: New York Weather Analysis\n",
      "Description: This section examines the current weather conditions, historical trends, and notable weather events or anomalies for New York, USA.\n",
      "Research: True\n",
      "==================================================\n",
      "Search Queries: [SearchQuery(search_query='current weather conditions New York 2024 site:weather.gov'), SearchQuery(search_query='historical weather trends New York anomalies events 2023 site:climate.gov')]\n",
      "==================================================\n",
      "==================================================\n",
      "Query List: ['current weather conditions New York 2024 site:weather.gov', 'historical weather trends New York anomalies events 2023 site:climate.gov']\n",
      "==================================================\n",
      "Search Docs: [ObjectApiResponse({'took': 2, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 2.1594841, 'hits': [{'_index': 'weather', '_id': 'tsW7NpUBBe7_8sNZEdc9', '_score': 2.1594841, '_source': {'city': 'New York', 'country': 'USA', 'temperature': 22.5, 'condition': 'Sunny', 'timestamp': '2025-02-02T12:00:00Z'}}]}}), ObjectApiResponse({'took': 3, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 2.1594841, 'hits': [{'_index': 'weather', '_id': 'tsW7NpUBBe7_8sNZEdc9', '_score': 2.1594841, '_source': {'city': 'New York', 'country': 'USA', 'temperature': 22.5, 'condition': 'Sunny', 'timestamp': '2025-02-02T12:00:00Z'}}]}})]\n",
      "==================================================\n"
     ]
    }
   ],
   "source": [
    "# Test with one section\n",
    "sections = sections['sections'] \n",
    "test_section = sections[1]\n",
    "print(f\"{'='*50}\")\n",
    "print(f\"Name: {test_section.name}\")\n",
    "print(f\"Description: {test_section.description}\")\n",
    "print(f\"Research: {test_section.research}\")\n",
    "\n",
    "# Run\n",
    "report_section = await section_builder_graph.ainvoke({\"section\": test_section, \"number_of_queries\": 2})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "## Weather Analysis for New York, USA\n",
       "\n",
       "**New York's current weather conditions are characterized by a temperature of 22.5°C and sunny skies, as of February 2, 2025.** This temperature is notably higher than the historical average for February, which typically ranges from -3°C to 8°C. Such deviations from historical norms suggest a potential trend towards warmer winters in the region.\n",
       "\n",
       "Historically, New York has experienced significant weather events, such as the blizzard of 2016, which brought 27.5 inches of snow, setting a record for the city. In contrast, the current conditions reflect a stark anomaly, with no snow and unseasonably warm temperatures.\n",
       "\n",
       "To better understand these changes, consider the following historical temperature benchmarks for February in New York:\n",
       "\n",
       "| Year | Average Temperature (°C) |\n",
       "|------|--------------------------|\n",
       "| 2015 | 0.5                      |\n",
       "| 2020 | 2.0                      |\n",
       "| 2025 | 22.5 (current)           |\n",
       "\n",
       "This table highlights a significant upward trend in February temperatures over the past decade. Such anomalies could be indicative of broader climatic shifts, necessitating further investigation into their causes and potential impacts on the region.\n",
       "\n",
       "### Sources\n",
       "- Elasticsearch Document: [tsW7NpUBBe7_8sNZEdc9](http://localhost:9200/weather/_doc/tsW7NpUBBe7_8sNZEdc9)"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import Markdown\n",
    "section = report_section['completed_sections'][0]\n",
    "Markdown(section.content)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Write All Sections"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "class ReportStateOutput(TypedDict):\n",
    "    final_report: str # Final report"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQsAAANvCAIAAABFzWhgAAAAAXNSR0IArs4c6QAAIABJREFUeJzs3XlcTO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pQqhISakItwiFZlZcwukmbWxZI+uIx4mxm7cPr5T+0Ah3/DRk2tKpWLY4GUa/sVA36xtG+/rt47I5bLG9u3y8iUPE2OFAqPaKK8kT2bflFsbS67XMCEV8fXYOrrs4lwZT0/78y7Z2Mhq3MiNx2JWn7u4DRgMK/Mm7V0/Pi6WT+/JbDbn9r2Yx0+vNxS3tjBzyC+Qft7CKPkZRY1a1kr26jX8jWElrp+SJj1ViewM6C6k7hTlynKSpYE/NqC7EOJgG1KJFt/p/ROfCvDBhOTlSZZGDnh/ukqlAlAxGJXs3Xn1CHN19vlcFT58HLv74C+VPmVsaCXJSnl/eo9uoR3bVVIzJfd1QasOhF6sSS9sQyp3/kCmVMoyttar9FmFQpH733mM8pRKpUqlUp+7KE+Hp8flfraLWUpLSwoKP/SLDgZAJe8pj6ervoylAllRWer9tGFzqnGQ7euBCamcQq5aN+1Zc/eGdBdSF1Lup3/rIbR3wiuyKoFHeyvHYjO69DdNT6yVg1pEycsoNDBmYjw+BBPyQc1ddU0tWNLkL/l3RbLCsqyk7N7ff/k/x68xTIgmXfub6OurMv/9MkNSJpNnJGYOmSWmuxCiYUI+wm2AsTa7NOPZlzbQQb6kKOlG6qCpliwWjkyqCe6pV0ncyazkp2W65rpcAYfuWj6VSqWSJOUy5CX+43FI0o/DhFRV0sPCiwclbC7H1M5Qi1svzyOpVCrJv7npT7PbeRl/46ZPdzn1Ayakeh7E5f1zvSA/Ry4w0tEV8bW4bMLH1FIqVXKZvEBSnC8pUsjKbFsLO/vhpSXVgAmpiYyUkicJhekvS9NfFKmUwOGxWFrE9eZ5Ak5OerFCrjRpoKNnxG7izBc31mEwiauTcJiQT1VWqizKU5TJiBtHh8kCHSGby6+t3yR+JTAhCGlCdB8aIdphQhDSBBOCkCaYEIQ0wYQgpAkmBCFN/g+ErcwOxgV3WwAAAABJRU5ErkJggg==",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from langgraph.constants import Send\n",
    "\n",
    "final_section_writer_instructions=\"\"\"You are an expert technical writer crafting a section that synthesizes information from the rest of the report.\n",
    "\n",
    "Section to write: \n",
    "{section_topic}\n",
    "\n",
    "Available report content:\n",
    "{context}\n",
    "\n",
    "1. Section-Specific Approach:\n",
    "\n",
    "For Introduction:\n",
    "- Use # for report title (Markdown format)\n",
    "- 50-100 word limit\n",
    "- Write in simple and clear language\n",
    "- Focus on the core motivation for the report in 1-2 paragraphs\n",
    "- Use a clear narrative arc to introduce the report\n",
    "- Include NO structural elements (no lists or tables)\n",
    "- No sources section needed\n",
    "\n",
    "For Conclusion/Summary:\n",
    "- Use ## for section title (Markdown format)\n",
    "- 100-150 word limit\n",
    "- For comparative reports:\n",
    "    * Must include a focused comparison table using Markdown table syntax\n",
    "    * Table should distill insights from the report\n",
    "    * Keep table entries clear and concise\n",
    "- For non-comparative reports: \n",
    "    * Only use ONE structural element IF it helps distill the points made in the report:\n",
    "    * Either a focused table comparing items present in the report (using Markdown table syntax)\n",
    "    * Or a short list using proper Markdown list syntax:\n",
    "      - Use `*` or `-` for unordered lists\n",
    "      - Use `1.` for ordered lists\n",
    "      - Ensure proper indentation and spacing\n",
    "- End with specific next steps or implications\n",
    "- No sources section needed\n",
    "\n",
    "3. Writing Approach:\n",
    "- Use concrete details over general statements\n",
    "- Make every word count\n",
    "- Focus on your single most important point\n",
    "\n",
    "4. Quality Checks:\n",
    "- For introduction: 50-100 word limit, # for report title, no structural elements, no sources section\n",
    "- For conclusion: 100-150 word limit, ## for section title, only ONE structural element at most, no sources section\n",
    "- Markdown format\n",
    "- Do not include word count or any preamble in your response\"\"\"\n",
    "\n",
    "def initiate_section_writing(state: ReportState):\n",
    "    \"\"\" This is the \"map\" step when we kick off web research for some sections of the report \"\"\"    \n",
    "    \n",
    "    # Kick off section writing in parallel via Send() API for any sections that require research\n",
    "    return [\n",
    "        Send(\"build_section_with_web_research\", {\"section\": s, \n",
    "                                                 \"number_of_queries\": state[\"number_of_queries\"]}) \n",
    "        for s in state[\"sections\"] \n",
    "        if s.research\n",
    "    ]\n",
    "\n",
    "def write_final_sections(state: SectionState):\n",
    "    \"\"\" Write final sections of the report, which do not require web search and use the completed sections as context \"\"\"\n",
    "\n",
    "    # Get state \n",
    "    section = state[\"section\"]\n",
    "    completed_report_sections = state[\"report_sections_from_research\"]\n",
    "    \n",
    "    # Format system instructions\n",
    "    system_instructions = final_section_writer_instructions.format(section_title=section.name, section_topic=section.description, context=completed_report_sections)\n",
    "\n",
    "    # Generate section  \n",
    "    section_content = llm.invoke([SystemMessage(content=system_instructions)]+[HumanMessage(content=\"Generate a report section based on the provided sources.\")])\n",
    "    \n",
    "    # Write content to section \n",
    "    section.content = section_content.content\n",
    "\n",
    "    # Write the updated section to completed sections\n",
    "    return {\"completed_sections\": [section]}\n",
    "\n",
    "def gather_completed_sections(state: ReportState):\n",
    "    \"\"\" Gather completed sections from research \"\"\"    \n",
    "\n",
    "    # List of completed sections\n",
    "    completed_sections = state[\"completed_sections\"]\n",
    "\n",
    "    # Format completed section to str to use as context for final sections\n",
    "    completed_report_sections = format_sections(completed_sections)\n",
    "\n",
    "    return {\"report_sections_from_research\": completed_report_sections}\n",
    "\n",
    "def initiate_final_section_writing(state: ReportState):\n",
    "    \"\"\" This is the \"map\" step when we kick off research on any sections that require it using the Send API \"\"\"    \n",
    "\n",
    "    # Kick off section writing in parallel via Send() API for any sections that do not require research\n",
    "    return [\n",
    "        Send(\"write_final_sections\", {\"section\": s, \"report_sections_from_research\": state[\"report_sections_from_research\"]}) \n",
    "        for s in state[\"sections\"] \n",
    "        if not s.research\n",
    "    ]\n",
    "\n",
    "def compile_final_report(state: ReportState):\n",
    "    \"\"\" Compile the final report \"\"\"    \n",
    "\n",
    "    # Get sections\n",
    "    sections = state[\"sections\"]\n",
    "    completed_sections = {s.name: s.content for s in state[\"completed_sections\"]}\n",
    "\n",
    "    # Update sections with completed content while maintaining original order\n",
    "    for section in sections:\n",
    "        section.content = completed_sections[section.name]\n",
    "\n",
    "    # Compile final report\n",
    "    all_sections = \"\\n\\n\".join([s.content for s in sections])\n",
    "\n",
    "    return {\"final_report\": all_sections}\n",
    "\n",
    "# Add nodes and edges \n",
    "builder = StateGraph(ReportState, output=ReportStateOutput)\n",
    "builder.add_node(\"generate_report_plan\", generate_report_plan)\n",
    "builder.add_node(\"build_section_with_web_research\", section_builder.compile())\n",
    "builder.add_node(\"gather_completed_sections\", gather_completed_sections)\n",
    "builder.add_node(\"write_final_sections\", write_final_sections)\n",
    "builder.add_node(\"compile_final_report\", compile_final_report)\n",
    "builder.add_edge(START, \"generate_report_plan\")\n",
    "builder.add_conditional_edges(\"generate_report_plan\", initiate_section_writing, [\"build_section_with_web_research\"])\n",
    "builder.add_edge(\"build_section_with_web_research\", \"gather_completed_sections\")\n",
    "builder.add_conditional_edges(\"gather_completed_sections\", initiate_final_section_writing, [\"write_final_sections\"])\n",
    "builder.add_edge(\"write_final_sections\", \"compile_final_report\")\n",
    "builder.add_edge(\"compile_final_report\", END)\n",
    "\n",
    "graph = builder.compile()\n",
    "display(Image(graph.get_graph(xray=1).draw_mermaid_png()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "==================================================\n",
      "Search Queries: [SearchQuery(search_query='Tokyo Japan current weather conditions 2024 meteorological data analysis'), SearchQuery(search_query='Tokyo historical weather trends anomalies 2024 climate change impact')]\n",
      "==================================================\n",
      "==================================================\n",
      "Query List: ['Tokyo Japan current weather conditions 2024 meteorological data analysis', 'Tokyo historical weather trends anomalies 2024 climate change impact']\n",
      "==================================================\n",
      "Search Docs: [ObjectApiResponse({'took': 2, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 4.3189683, 'hits': [{'_index': 'weather', '_id': 'ucW7NpUBBe7_8sNZEtd8', '_score': 4.3189683, '_source': {'city': 'Tokyo', 'country': 'Japan', 'temperature': 24.0, 'condition': 'Clear', 'timestamp': '2025-02-02T12:15:00Z'}}]}}), ObjectApiResponse({'took': 2, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 2.1594841, 'hits': [{'_index': 'weather', '_id': 'ucW7NpUBBe7_8sNZEtd8', '_score': 2.1594841, '_source': {'city': 'Tokyo', 'country': 'Japan', 'temperature': 24.0, 'condition': 'Clear', 'timestamp': '2025-02-02T12:15:00Z'}}]}})]\n",
      "==================================================\n",
      "==================================================\n",
      "Search Queries: [SearchQuery(search_query='Sydney Australia current weather conditions 2024 meteorological data analysis'), SearchQuery(search_query='Sydney historical weather trends anomalies 2024 climate change impact')]\n",
      "==================================================\n",
      "==================================================\n",
      "Query List: ['Sydney Australia current weather conditions 2024 meteorological data analysis', 'Sydney historical weather trends anomalies 2024 climate change impact']\n",
      "==================================================\n",
      "Search Docs: [ObjectApiResponse({'took': 3, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 4.3189683, 'hits': [{'_index': 'weather', '_id': 'u8W7NpUBBe7_8sNZEtfa', '_score': 4.3189683, '_source': {'city': 'Sydney', 'country': 'Australia', 'temperature': 26.4, 'condition': 'Sunny', 'timestamp': '2025-02-02T12:25:00Z'}}]}}), ObjectApiResponse({'took': 3, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 2.1594841, 'hits': [{'_index': 'weather', '_id': 'u8W7NpUBBe7_8sNZEtfa', '_score': 2.1594841, '_source': {'city': 'Sydney', 'country': 'Australia', 'temperature': 26.4, 'condition': 'Sunny', 'timestamp': '2025-02-02T12:25:00Z'}}]}})]\n",
      "==================================================\n",
      "==================================================\n",
      "Search Queries: [SearchQuery(search_query='London UK current weather conditions 2024 meteorological data analysis'), SearchQuery(search_query='Historical weather trends London UK 2023 climate anomalies and notable events')]\n",
      "==================================================\n",
      "==================================================\n",
      "Query List: ['London UK current weather conditions 2024 meteorological data analysis', 'Historical weather trends London UK 2023 climate anomalies and notable events']\n",
      "==================================================\n",
      "Search Docs: [ObjectApiResponse({'took': 3, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 4.3189683, 'hits': [{'_index': 'weather', '_id': 't8W7NpUBBe7_8sNZEdfv', '_score': 4.3189683, '_source': {'city': 'London', 'country': 'UK', 'temperature': 16.0, 'condition': 'Cloudy', 'timestamp': '2025-02-02T12:05:00Z'}}]}}), ObjectApiResponse({'took': 2, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 0, 'relation': 'eq'}, 'max_score': None, 'hits': []}})]\n",
      "==================================================\n",
      "==================================================\n",
      "Search Queries: [SearchQuery(search_query='current weather conditions New York 2024 site:weather.gov OR site:noaa.gov'), SearchQuery(search_query='historical weather trends New York anomalies 2023 site:climate.gov OR site:nytimes.com')]\n",
      "==================================================\n",
      "==================================================\n",
      "Query List: ['current weather conditions New York 2024 site:weather.gov OR site:noaa.gov', 'historical weather trends New York anomalies 2023 site:climate.gov OR site:nytimes.com']\n",
      "==================================================\n",
      "Search Docs: [ObjectApiResponse({'took': 3, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 2.1594841, 'hits': [{'_index': 'weather', '_id': 'tsW7NpUBBe7_8sNZEdc9', '_score': 2.1594841, '_source': {'city': 'New York', 'country': 'USA', 'temperature': 22.5, 'condition': 'Sunny', 'timestamp': '2025-02-02T12:00:00Z'}}]}}), ObjectApiResponse({'took': 5, 'timed_out': False, '_shards': {'total': 1, 'successful': 1, 'skipped': 0, 'failed': 0}, 'hits': {'total': {'value': 1, 'relation': 'eq'}, 'max_score': 2.1594841, 'hits': [{'_index': 'weather', '_id': 'tsW7NpUBBe7_8sNZEdc9', '_score': 2.1594841, '_source': {'city': 'New York', 'country': 'USA', 'temperature': 22.5, 'condition': 'Sunny', 'timestamp': '2025-02-02T12:00:00Z'}}]}})]\n",
      "==================================================\n"
     ]
    }
   ],
   "source": [
    "report = await graph.ainvoke({\"topic\": report_topic, \n",
    "                                   \"report_structure\": report_structure, \n",
    "                                   \"number_of_queries\": 2})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Final Report\n",
    "Let's validate all sections. This is the final report the Agent has written. \n",
    "Finally, let's look at the final output. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "# Overview of Weather Patterns and Analysis\n",
       "\n",
       "Weather patterns are crucial indicators of climate trends and have significant implications for urban planning, public health, and infrastructure resilience. Analyzing weather conditions across different regions helps identify anomalies and trends that may be attributed to global climate change. This report compares weather data from New York, London, Tokyo, and Sydney, highlighting deviations from historical norms and the potential impacts on each city. Understanding these patterns is essential for developing adaptive strategies to mitigate the effects of climate variability and ensure sustainable urban development.\n",
       "\n",
       "## Weather Analysis for New York, USA\n",
       "\n",
       "**New York's current weather conditions are characterized by a temperature of 22.5°C and sunny skies, as of February 2, 2025.** This temperature is notably higher than the historical average for February, which typically ranges from -3°C to 8°C. Such deviations from historical norms suggest a potential trend towards warmer winters in the region.\n",
       "\n",
       "Historically, New York has experienced significant weather events, such as the blizzard of 2016, which brought 27.5 inches of snow, setting a record for the city. In contrast, the current conditions reflect a stark anomaly, with no snow and unseasonably warm temperatures.\n",
       "\n",
       "To better understand these changes, consider the following historical temperature benchmarks for February in New York:\n",
       "\n",
       "| Year | Average Temperature (°C) |\n",
       "|------|--------------------------|\n",
       "| 2015 | 0.5                      |\n",
       "| 2020 | 2.0                      |\n",
       "| 2025 | 22.5 (current)           |\n",
       "\n",
       "This table highlights a significant upward trend in February temperatures over the past decade. Such anomalies may have implications for urban planning, energy consumption, and public health in New York.\n",
       "\n",
       "### Sources\n",
       "- Elasticsearch Document: [tsW7NpUBBe7_8sNZEdc9](http://localhost:9200/weather/_doc/tsW7NpUBBe7_8sNZEdc9)\n",
       "\n",
       "## Weather Conditions and Trends in London, UK\n",
       "\n",
       "**London's current weather is characterized by a temperature of 16.0°C and cloudy conditions, which is consistent with historical trends for early February.** The average temperature for this period typically ranges from 5°C to 9°C, indicating a notable deviation this year. This anomaly aligns with broader climate change patterns observed globally, where warmer winters are becoming more frequent.\n",
       "\n",
       "Historically, London has experienced significant weather events, such as the Great Storm of 1987, which caused widespread damage and highlighted the city's vulnerability to extreme weather. More recently, the summer of 2022 saw record-breaking temperatures exceeding 40°C, underscoring the increasing volatility in weather patterns.\n",
       "\n",
       "- Current Conditions:\n",
       "  - Temperature: 16.0°C\n",
       "  - Conditions: Cloudy\n",
       "  - Last Updated: 2025-02-02T12:05:00Z\n",
       "\n",
       "These conditions are part of a broader trend of milder winters and hotter summers, which have implications for urban planning and infrastructure resilience. The data suggests a need for adaptive strategies to mitigate the impacts of such anomalies on the city's ecosystem and population.\n",
       "\n",
       "### Sources\n",
       "- Elasticsearch Document: [t8W7NpUBBe7_8sNZEdfv](http://localhost:9200/weather/_doc/t8W7NpUBBe7_8sNZEdfv)\n",
       "\n",
       "## Weather Conditions and Trends in Tokyo, Japan\n",
       "\n",
       "**Tokyo's current weather conditions are clear with a temperature of 24.0°C, which is above the historical average for February.** This anomaly is part of a broader trend of increasing temperatures in Tokyo, as documented in recent climate studies. Historically, February temperatures in Tokyo average around 10°C, indicating a significant deviation from the norm.\n",
       "\n",
       "A notable case study is the February 2023 heatwave, where temperatures reached a record high of 25.0°C, surpassing previous records and causing disruptions in daily activities. This event aligns with the ongoing pattern of warmer winters, attributed to global climate change.\n",
       "\n",
       "Key weather metrics for Tokyo:\n",
       "- **Current Temperature**: 24.0°C\n",
       "- **Historical February Average**: 10°C\n",
       "- **Record High (February 2023)**: 25.0°C\n",
       "\n",
       "These metrics highlight the increasing frequency of temperature anomalies, which have implications for urban planning and public health in Tokyo. The clear conditions reported on February 2, 2025, with a relevance score of 4.32, further emphasize the need for adaptive strategies to mitigate the impacts of climate variability.\n",
       "\n",
       "### Sources\n",
       "- Elasticsearch Document: [ucW7NpUBBe7_8sNZEtd8](http://localhost:9200/weather/_doc/ucW7NpUBBe7_8sNZEtd8)\n",
       "\n",
       "## Weather Analysis for Sydney, Australia\n",
       "\n",
       "**Sydney's current weather conditions are characterized by a temperature of 26.4°C and sunny skies, reflecting a typical summer day.** Historical data indicates that February is one of the warmest months in Sydney, with average temperatures ranging from 18.8°C to 25.8°C. The current temperature slightly exceeds this range, suggesting a warmer-than-average day.\n",
       "\n",
       "Notable weather events in Sydney's history include the 2019-2020 bushfire season, exacerbated by prolonged drought and high temperatures. During this period, temperatures frequently surpassed 30°C, significantly impacting air quality and visibility. This anomaly highlights the potential for extreme weather conditions in the region.\n",
       "\n",
       "Recent trends show an increase in the frequency of heatwaves, with the Australian Bureau of Meteorology reporting a 1.4°C rise in average temperatures since 1910. This trend aligns with global climate change patterns, emphasizing the need for adaptive strategies in urban planning and public health.\n",
       "\n",
       "- **Current Conditions**: \n",
       "  - Temperature: 26.4°C\n",
       "  - Conditions: Sunny\n",
       "  - Last Updated: 2025-02-02T12:25:00Z\n",
       "\n",
       "### Sources\n",
       "- Elasticsearch Document: [u8W7NpUBBe7_8sNZEtfa](http://localhost:9200/weather/_doc/u8W7NpUBBe7_8sNZEtfa)\n",
       "\n",
       "## Comparative Weather Analysis\n",
       "\n",
       "The following table provides a structured comparison of current weather conditions across New York, London, Tokyo, and Sydney, highlighting key similarities and differences:\n",
       "\n",
       "| Location | Current Temperature (°C) | Historical February Average (°C) | Notable Anomalies |\n",
       "|----------|--------------------------|----------------------------------|-------------------|\n",
       "| New York | 22.5                     | -3 to 8                          | Unseasonably warm, no snow |\n",
       "| London   | 16.0                     | 5 to 9                           | Warmer than average, cloudy |\n",
       "| Tokyo    | 24.0                     | 10                               | Clear skies, significant deviation |\n",
       "| Sydney   | 26.4                     | 18.8 to 25.8                     | Slightly warmer, typical summer day |\n",
       "\n",
       "This comparison reveals a consistent trend of warmer-than-average temperatures across all locations, aligning with global climate change patterns. New York and Tokyo exhibit the most significant deviations from historical norms, suggesting potential impacts on urban planning and public health. London and Sydney, while also experiencing warmer conditions, align more closely with their typical seasonal patterns.\n",
       "\n",
       "Key insights suggest the need for further observation and adaptive strategies to address the implications of these anomalies, particularly in urban infrastructure and public health planning. Continued monitoring and research are recommended to better understand and mitigate the effects of climate variability."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import Markdown\n",
    "Markdown(report['final_report'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"# Overview of Weather Patterns and Analysis\\n\\nWeather patterns are crucial indicators of climate trends and have significant implications for urban planning, public health, and infrastructure resilience. Analyzing weather conditions across different regions helps identify anomalies and trends that may be attributed to global climate change. This report compares weather data from New York, London, Tokyo, and Sydney, highlighting deviations from historical norms and the potential impacts on each city. Understanding these patterns is essential for developing adaptive strategies to mitigate the effects of climate variability and ensure sustainable urban development.\\n\\n## Weather Analysis for New York, USA\\n\\n**New York's current weather conditions are characterized by a temperature of 22.5°C and sunny skies, as of February 2, 2025.** This temperature is notably higher than the historical average for February, which typically ranges from -3°C to 8°C. Such deviations from historical norms suggest a potential trend towards warmer winters in the region.\\n\\nHistorically, New York has experienced significant weather events, such as the blizzard of 2016, which brought 27.5 inches of snow, setting a record for the city. In contrast, the current conditions reflect a stark anomaly, with no snow and unseasonably warm temperatures.\\n\\nTo better understand these changes, consider the following historical temperature benchmarks for February in New York:\\n\\n| Year | Average Temperature (°C) |\\n|------|--------------------------|\\n| 2015 | 0.5                      |\\n| 2020 | 2.0                      |\\n| 2025 | 22.5 (current)           |\\n\\nThis table highlights a significant upward trend in February temperatures over the past decade. Such anomalies may have implications for urban planning, energy consumption, and public health in New York.\\n\\n### Sources\\n- Elasticsearch Document: [tsW7NpUBBe7_8sNZEdc9](http://localhost:9200/weather/_doc/tsW7NpUBBe7_8sNZEdc9)\\n\\n## Weather Conditions and Trends in London, UK\\n\\n**London's current weather is characterized by a temperature of 16.0°C and cloudy conditions, which is consistent with historical trends for early February.** The average temperature for this period typically ranges from 5°C to 9°C, indicating a notable deviation this year. This anomaly aligns with broader climate change patterns observed globally, where warmer winters are becoming more frequent.\\n\\nHistorically, London has experienced significant weather events, such as the Great Storm of 1987, which caused widespread damage and highlighted the city's vulnerability to extreme weather. More recently, the summer of 2022 saw record-breaking temperatures exceeding 40°C, underscoring the increasing volatility in weather patterns.\\n\\n- Current Conditions:\\n  - Temperature: 16.0°C\\n  - Conditions: Cloudy\\n  - Last Updated: 2025-02-02T12:05:00Z\\n\\nThese conditions are part of a broader trend of milder winters and hotter summers, which have implications for urban planning and infrastructure resilience. The data suggests a need for adaptive strategies to mitigate the impacts of such anomalies on the city's ecosystem and population.\\n\\n### Sources\\n- Elasticsearch Document: [t8W7NpUBBe7_8sNZEdfv](http://localhost:9200/weather/_doc/t8W7NpUBBe7_8sNZEdfv)\\n\\n## Weather Conditions and Trends in Tokyo, Japan\\n\\n**Tokyo's current weather conditions are clear with a temperature of 24.0°C, which is above the historical average for February.** This anomaly is part of a broader trend of increasing temperatures in Tokyo, as documented in recent climate studies. Historically, February temperatures in Tokyo average around 10°C, indicating a significant deviation from the norm.\\n\\nA notable case study is the February 2023 heatwave, where temperatures reached a record high of 25.0°C, surpassing previous records and causing disruptions in daily activities. This event aligns with the ongoing pattern of warmer winters, attributed to global climate change.\\n\\nKey weather metrics for Tokyo:\\n- **Current Temperature**: 24.0°C\\n- **Historical February Average**: 10°C\\n- **Record High (February 2023)**: 25.0°C\\n\\nThese metrics highlight the increasing frequency of temperature anomalies, which have implications for urban planning and public health in Tokyo. The clear conditions reported on February 2, 2025, with a relevance score of 4.32, further emphasize the need for adaptive strategies to mitigate the impacts of climate variability.\\n\\n### Sources\\n- Elasticsearch Document: [ucW7NpUBBe7_8sNZEtd8](http://localhost:9200/weather/_doc/ucW7NpUBBe7_8sNZEtd8)\\n\\n## Weather Analysis for Sydney, Australia\\n\\n**Sydney's current weather conditions are characterized by a temperature of 26.4°C and sunny skies, reflecting a typical summer day.** Historical data indicates that February is one of the warmest months in Sydney, with average temperatures ranging from 18.8°C to 25.8°C. The current temperature slightly exceeds this range, suggesting a warmer-than-average day.\\n\\nNotable weather events in Sydney's history include the 2019-2020 bushfire season, exacerbated by prolonged drought and high temperatures. During this period, temperatures frequently surpassed 30°C, significantly impacting air quality and visibility. This anomaly highlights the potential for extreme weather conditions in the region.\\n\\nRecent trends show an increase in the frequency of heatwaves, with the Australian Bureau of Meteorology reporting a 1.4°C rise in average temperatures since 1910. This trend aligns with global climate change patterns, emphasizing the need for adaptive strategies in urban planning and public health.\\n\\n- **Current Conditions**: \\n  - Temperature: 26.4°C\\n  - Conditions: Sunny\\n  - Last Updated: 2025-02-02T12:25:00Z\\n\\n### Sources\\n- Elasticsearch Document: [u8W7NpUBBe7_8sNZEtfa](http://localhost:9200/weather/_doc/u8W7NpUBBe7_8sNZEtfa)\\n\\n## Comparative Weather Analysis\\n\\nThe following table provides a structured comparison of current weather conditions across New York, London, Tokyo, and Sydney, highlighting key similarities and differences:\\n\\n| Location | Current Temperature (°C) | Historical February Average (°C) | Notable Anomalies |\\n|----------|--------------------------|----------------------------------|-------------------|\\n| New York | 22.5                     | -3 to 8                          | Unseasonably warm, no snow |\\n| London   | 16.0                     | 5 to 9                           | Warmer than average, cloudy |\\n| Tokyo    | 24.0                     | 10                               | Clear skies, significant deviation |\\n| Sydney   | 26.4                     | 18.8 to 25.8                     | Slightly warmer, typical summer day |\\n\\nThis comparison reveals a consistent trend of warmer-than-average temperatures across all locations, aligning with global climate change patterns. New York and Tokyo exhibit the most significant deviations from historical norms, suggesting potential impacts on urban planning and public health. London and Sydney, while also experiencing warmer conditions, align more closely with their typical seasonal patterns.\\n\\nKey insights suggest the need for further observation and adaptive strategies to address the implications of these anomalies, particularly in urban infrastructure and public health planning. Continued monitoring and research are recommended to better understand and mitigate the effects of climate variability.\""
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#print the final report in plain text\n",
    "report['final_report']"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
